package rkw.database.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "votes")
public class Vote implements Serializable {
	private static final long serialVersionUID = 1905557921005711697L;

	@Id
	@Column(name = "id")
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id = null;
	@Column(name = "value", nullable = false, unique = true, length = 45)
	private String value;
	@ManyToOne
	@JoinColumn(name = "election", insertable = false, updatable = true)
	private Election election;
	
	public Long getId() {
		return id;
	}

	@SuppressWarnings("unused")
	private void setId(Long id) {
		this.id = id;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}
	
	public Election getElection() {
		return election;
	}

	public void setElection(Election election) {
		this.election = election;
	}
}
